#Gerard Choinka (c) 2009
#     This program is free software: you can redistribute it and/or modify
#     it under the terms of the GNU General Public License as published by
#     the Free Software Foundation, either version 3 of the License, or
#     (at your option) any later version.
# 
#     This program is distributed in the hope that it will be useful,
#     but WITHOUT ANY WARRANTY; without even the implied warranty of
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#     GNU General Public License for more details.
# 
#     You should have received a copy of the GNU General Public License
#     along with this program.  If not, see <http://www.gnu.org/licenses/>.


CCFLAGS=-std=c++98 -g
BILDDIR=./build/

VPATH=$(BILDDIR)


all: robs pls camserver
.build_direxist:
	mkdir $(BILDDIR)
	touch $(BILDDIR).build_direxist



robs: .build_direxist robs.o pslsimfunc.o
	cd $(BILDDIR) && \
	g++ $(CCFLAGS) robs.o pslsimfunc.o -o robs

pls: .build_direxist pls.o pslsimfunc.o
	cd $(BILDDIR) && \
	g++ $(CCFLAGS) pls.o pslsimfunc.o -I/usr/include/opencv -lcv -lhighgui -o pls

camserver: .build_direxist camserver.o pslsimfunc.o
	cd $(BILDDIR) && \
	g++ $(CCFLAGS) camserver.o pslsimfunc.o -I/usr/include/opencv -lcv -lhighgui -o camserver


robs.o: robs.cpp
	g++ $(CCFLAGS) -c robs.cpp -o $(BILDDIR)robs.o

pls.o: pls.cpp
	g++ $(CCFLAGS) -c pls.cpp -o $(BILDDIR)pls.o

camserver.o: camserver.cpp
	g++ $(CCFLAGS) -c camserver.cpp -o $(BILDDIR)camserver.o

pslsimfunc.o: pslsimfunc.cpp
	g++ $(CCFLAGS) -c pslsimfunc.cpp -o $(BILDDIR)pslsimfunc.o


clean:
	@rm $(BILDDIR)/* -rf
